<?php

// @formatter:off
/**
 * @file list.php
 * @author Alejandro Dario Simi
 * @date $Date: 2014-06-03 03:40:32 +0000 (Tue, 03 Jun 2014) $
 *
 * $Id: list.php 112 2014-06-03 03:40:32Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/trunk/services/users/list.php $
 */
// @formatter:on

require_once __DIR__."/tools.php";

class WCServiceUsersList extends WCService {
	//
	// Class methods.
	public function __construct() {
		parent::__construct();

		$this->_requiredPermissions["to"][] = WC_PERM_USER_LIST;

		$this->_useCache = true;
	}
	//
	// Protected methods.
	protected function runGET() {
		global $wcUsersHolder;
		//
		// Directory tags list requested.
		foreach($wcUsersHolder->items() as $user) {
			$this->_results[] = array(
				"id" => $user->id(),
				"name" => $user->name()
			);
			$this->_count++;
		}
	}
}
